package com.lulin.mall.order.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;
import java.util.Set;

/**
 * 订单的异步处理问题
 *
 * @author lulin
 * @date 2023/1/3 15:58
 */
@Controller
public class OrderPayListener {

    /**
     * 支付成功的异步回调接口
     */
    @RequestMapping("/orderPay/payed/notifyUrl")
    public String handleAlipayed(HttpServletRequest request) {
        System.out.println("-------------》 支付成功的异步回调接口---");
        Map<String, String[]> parameterMap = request.getParameterMap();
        Set<String> keys = parameterMap.keySet();
        for (String key : keys) {
            System.out.println(key + ":" + parameterMap.get(key));
        }
        return "success";
    }
}
